<%
// General macro for inserting a secure context notice, i.e. to mark a
// feature as only available on secure contexts. See the following page:
// https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
//
// Parameters:
//  $0  The type of warning indicator: inline/header

var lang = env.locale;

var str_title = mdn.localString({
  "en-US": "Secure context",
  "es"   : "Contexto seguro",
  "fr"   : "Contexte sécurisé",
  "ja"   : "安全なコンテキスト用",
  "zh-CN": "安全上下文"
});

var str_tooltip = mdn.localString({
  "en-US": "This feature is available only in secure contexts (HTTPS)",
  "es"   : "Esta función está disponible solo en contextos seguros (HTTPS)",
  "fr"   : "Cette fonctionnalité est uniquement disponible dans des contextes sécurisés (HTTPS)",
  "ja"   : "この機能は安全なコンテキスト (HTTPS) でのみ利用できます",
  "zh-CN": "此功能仅在安全上下文（HTTPS）中可用"
});

var str_desc = mdn.localString({
  "en-US": "This feature is available only in <a href='/" + lang + "/docs/Web/Security/Secure_Contexts'>secure contexts</a> (HTTPS), in some or all <a href='#browser_compatibility'>supporting browsers</a>.",
  "es"   : "Esta función está disponible solo en <a href='/" + lang + "/docs/Web/Security/Secure_Contexts'>contextos seguros</a> (HTTPS), en algunos o todos los <a href='#browser_compatibility'>navegadores que lo soportan</a>.",
  "fr"   : "Cette fonctionnalité est uniquement disponible dans des <a href='/" + lang + "/docs/Web/Security/Secure_Contexts'>contextes sécurisés</a> (HTTPS), pour certains <a href='#compatibilité_des_navigateurs'>navigateurs qui la prennent en charge</a>.",
  "ja"   : "この機能は一部またはすべての<a href='#browser_compatibility'>対応しているブラウザー</a>において、<a href='/" + lang + "/docs/Web/Security/Secure_Contexts'>安全なコンテキスト</a> (HTTPS) でのみ利用できます。",
  "zh-CN": "此项功能仅在<a href='/" + lang + "/docs/Web/Security/Secure_Contexts'>安全上下文</a>(HTTPS), 一些 <a href='#browser_compatibility'>支持的浏览器</a>."
});

if($0 === 'inline') {
  result = "<span class='notecard inline secure' title='" + str_tooltip + "'>" + str_title + "</span>";
} else if($0 === 'header') {
  result = "<div class='notecard secure'><h4>" + str_title + "</h4><p>" + str_desc + "</p></div>";
}
%>

<%- result %>
